package cn.iocoder.yudao.module.vehicle.dal.mysql.vehicleinfo;

import java.util.*;

import cn.iocoder.yudao.framework.common.pojo.PageResult;
import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX;
import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX;
import cn.iocoder.yudao.module.vehicle.dal.dataobject.vehicleinfo.vehicleinfoDO;
import org.apache.ibatis.annotations.Mapper;
import cn.iocoder.yudao.module.vehicle.controller.admin.vehicleinfo.vo.*;

/**
 * 车辆基本信息 Mapper
 *
 * @author 芋道源码
 */
@Mapper
public interface vehicleinfoMapper extends BaseMapperX<vehicleinfoDO> {

    default PageResult<vehicleinfoDO> selectPage(vehicleinfoPageReqVO reqVO) {
        return selectPage(reqVO, new LambdaQueryWrapperX<vehicleinfoDO>()
                .eqIfPresent(vehicleinfoDO::getLicensePlate, reqVO.getLicensePlate())
                .likeIfPresent(vehicleinfoDO::getDriverName, reqVO.getDriverName())
                .eqIfPresent(vehicleinfoDO::getVehicleType, reqVO.getVehicleType())
                .eqIfPresent(vehicleinfoDO::getProductionModel, reqVO.getProductionModel())
                .betweenIfPresent(vehicleinfoDO::getPurchaseDate, reqVO.getPurchaseDate())
                .eqIfPresent(vehicleinfoDO::getPurchasePrice, reqVO.getPurchasePrice())
                .eqIfPresent(vehicleinfoDO::getEngineModel, reqVO.getEngineModel())
                .eqIfPresent(vehicleinfoDO::getDescription, reqVO.getDescription())
                .eqIfPresent(vehicleinfoDO::getUsageMileage, reqVO.getUsageMileage())
                .eqIfPresent(vehicleinfoDO::getBelongingOrg, reqVO.getBelongingOrg())
                .eqIfPresent(vehicleinfoDO::getIsArchived, reqVO.getIsArchived())
                .eqIfPresent(vehicleinfoDO::getStatus, reqVO.getStatus())
                .betweenIfPresent(vehicleinfoDO::getCreateTime, reqVO.getCreateTime())
                .eqIfPresent(vehicleinfoDO::getRemark, reqVO.getRemark())
                .orderByDesc(vehicleinfoDO::getId));
    }

}